<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <input type="file" id="file">
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
  <script>
    $('#file').on('change', function(e) {
      var img = $('#file').prop("files")[0]
      var form = new FormData();
      form.append('id', '1')
      form.append('imgs', img)
      $.ajax({
        url:'http://localhost:3000/upload',
        method: 'post',
        data:form,
        cache: false,
        processData: false, 
        contentType: false, 
        success: function(res) {
          console.log(res)
        }
        
      })
    })
  </script>
</body>
</html>